<?php
	function fetchAddFormParameters(){
		$module = $_GET['mod'];
		switch($module){
			case 'group':
				$width 	= 420;
				$height = 400;
				$title 	= "Create New Group";
				break;
			case 'atsi':
				$width 	= 400;
				$height = 200;
				$title 	= "Create New ATSI";
				break;
			case 'healthfund':
				$width 	= 420;
				$height = 200;
				$title 	= "Create New Health Fund";
				break;
			case 'healthfundtype':
				$width 	= 420;
				$height = 200;
				$title 	= "Create New Health Fund Type";
				break;
			case 'user':
				$width 	= 750;
				$height = 420;
				$title 	= "Create New User";
				break;
			case 'patient':
				$width 	= 750;
				$height = 420;
				$title 	= "Create New Patient";
				break;
		}

		$addParams = array(
					'url' 		  => APP_ROOT.'/'.$module.'-new', 
					'titleHead'   => $title, 
					'widthParam'  => $width,
					'heightParam' => $height
				);
		$add = htmlentities(json_encode($addParams));
		return $add;
	}

	function fetchViewFormParameters($id = 0, $name = ""){
		$module = $_GET['mod'];
		switch($module){
			case 'group':
				$width 	= 420;
				$height = 370;
				break;
			case 'user':
				$width 	= 750;
				$height = 420;
				break;
			case 'patient':
				$width 	= 750;
				$height = 420;
				break;
		}

		$viewParams = array(
			'url' 		  => APP_ROOT.'/'.$module.'-detail&row='.$id, 
			'titleHead'   => 'View - '.$name,
			'widthParam'  => $width,
			'heightParam' => $height
		);
		$view = htmlentities(json_encode($viewParams));		
		return $view;
	}

	function fetchEditFormParameters($id = 0, $name = ""){
		$module = $_GET['mod'];
		switch($module){
			case 'group':
				$width 	= 420;
				$height = 400;
				break;
			case 'atsi':
				$width 	= 400;
				$height = 200;
				break;
			case 'healthfund':
				$width 	= 420;
				$height = 200;
				break;
			case 'healthfundtype':
				$width 	= 420;
				$height = 200;
				break;
			case 'user':
				$width 	= 750;
				$height = 420;
				break;
			case 'patient':
				$width 	= 750;
				$height = 420;
				break;
		}

		$editParams = array(
			'url' 		  => APP_ROOT.'/'.$module.'-edit&row='.$id,
			'titleHead'   => 'Edit - '.$name, 
			'widthParam'  => $width,
			'heightParam' => $height,
			'postid' 	  => $id, 
			'redirecturl' => APP_ROOT.'/'.$module
		);
		$edit = htmlentities(json_encode($editParams));
		return $edit;
	}

	function fetchDeleteFormParameters($id = 0, $name = ""){
		$module = $_GET['mod'];	
		$deleteParams = array(
			'url' 		  => APP_ROOT.'/'.$module.'-delete&row='.$id, 
			'titleHead'   => 'Delete - '.$name,
			'postid' 	  => $row['id'],
			'redirecturl' => APP_ROOT.'/'.$module
		);
		$delete = htmlentities(json_encode($deleteParams));
		return $delete;
	}

	function fetchSearchFormParameters(){
		$module = $_GET['mod'];
		switch($module){
			case 'patient':
				$width 	= 510;
				$height = 420;
				$title 	= "Filter Patient List";
				break;
		}

		$searchParams = array(
					'url' 		  => APP_ROOT.'/'.$module.'-search', 
					'titleHead'   => $title, 
					'widthParam'  => $width,
					'heightParam' => $height
				);
		$search = htmlentities(json_encode($searchParams));
		return $search;
	}
?>